import Vue from 'vue'
import Vuex from 'vuex'
import home from './modules/home.js'
import user from './modules/user.js'
import cart from './modules/cart.js'
import persistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [
    // vuex持久化插件
    persistedState({ storage: window.sessionStorage })
  ],
  modules: {
    home,
    user,
    cart
  }
})
